package org.jing.ext.web;

import javax.servlet.ServletConfig;
import javax.servlet.http.HttpServlet;
import java.util.Enumeration;

/**
 * Description: <br>
 *
 * @author bks <br>
 * @since 2021-03-03 <br>
 */
public class SystemPropertySetter extends HttpServlet {
    public void init() {
        ServletConfig config = getServletConfig();
        Enumeration<String> keys = config.getInitParameterNames();
        String key, value;
        while (keys.hasMoreElements()) {
            System.out.printf("SystemProperty.set [%s] to [%s]%n", key = keys.nextElement(), value = config.getInitParameter(key));
            System.setProperty(key, value);
        }
    }
}
